/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import java.io.IOException;
import net.aksingh.owmjapis.CurrentWeather;
import net.aksingh.owmjapis.OpenWeatherMap;
/**
 *
 * @author takamflore
 */
public class WeatherBean {
    
      // declaring object of "OpenWeatherMap" class
   
     public OpenWeatherMap owm = new OpenWeatherMap(""); 
     public  CurrentWeather cwd;
    // getting current weather data for the "London" city
   public CurrentWeather getCurrentWeather(String city) throws IOException{
       
            cwd = owm.currentWeatherByCityName(city);
           return cwd;
              }
        //printing city name from the retrieved data
   public String retrieveddata(){
        return "City: " + cwd.getCityName();
   }
        // printing the max./min. temperature
   
   public String TemeperatureInCity(String city) throws IOException{
       
    return (getCurrentWeather(city).getMainInstance().getMaxTemperature()+"\'F");
     }
   
   public String PressionInCity(String city) throws IOException{
       
      return (getCurrentWeather(city).getMainInstance().getPressure()+"\'F");                     
    }
   
   
   
   /*
   Current Weather
Weather Forecasts
Daily Forecasts
Wind degree to direction converter
   */
}
